#pragma once
#include <WS2tcpip.h>
#include <stdint.h>
#include <string>
#pragma comment(lib,"Ws2_32.lib")

class CIpAddress
{
public:
    CIpAddress();
    CIpAddress(std::string Ip, uint16_t port);
    CIpAddress(uint32_t Ip, uint16_t port);
    ~CIpAddress();

    void SetInit(std::string Ip, uint16_t port)
    {
        IpAdress.sin_family = AF_INET;
        IpAdress.sin_port = htons(port);
        inet_pton(AF_INET, Ip.c_str(), &IpAdress.sin_addr);
    }
    sockaddr* GetIpAdressStrut();
    uint32_t GetIpAdress();
    uint16_t GetPort();
    int GetSize();
    std::string ToString();

private:
    sockaddr_in IpAdress;
};

